// 导入变量
@use 'variables' as *;

// 弹性布局
@mixin flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

@mixin flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

@mixin flex-column {
  display: flex;
  flex-direction: column;
}

// 文本省略
@mixin text-ellipsis($lines: 1) {
  @if $lines == 1 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  } @else {
    display: -webkit-box;
    -webkit-line-clamp: $lines;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

// 响应式断点
@mixin mobile {
  @media (max-width: 768px) {
    @content;
  }
}

@mixin tablet {
  @media (min-width: 769px) and (max-width: 1199px) {
    @content;
  }
}

@mixin desktop {
  @media (min-width: 1200px) {
    @content;
  }
}

// 卡片样式
@mixin card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

// 按钮样式
@mixin button-primary {
  background: $primary-color;
  border-color: $primary-color;
  color: white;
  border-radius: 20px;
  font-weight: 500;
  
  &:hover {
    background: $primary-dark;
    border-color: $primary-dark;
  }
}

// 输入框样式
@mixin input-style {
  border-radius: 8px;
  
  &:focus {
    border-color: $primary-color;
    box-shadow: 0 0 0 1px $primary-color;
  }
}

// 过渡动画
@mixin transition($property: all, $duration: 0.2s, $timing: ease) {
  transition: $property $duration $timing;
}

// 悬停效果
@mixin hover-lift {
  @include transition(transform);
  
  &:hover {
    transform: translateY(-2px);
  }
}